package cn.tedu.mall.ams.exception;/*
package cn.tedu.mall.ams.exception;

import cn.tedu.mall.common.restful.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

*/
/**
 * 处理controller全局异常逻辑的处理器
 *//*

@RestControllerAdvice(basePackages = "cn.tedu.mall.ams.controller")
@Slf4j
public class GlobalControllerExceptionHandler {
    */
/**
     * 业务异常
     *//*

    @ExceptionHandler({CoolSharkException.class})
    public JsonResult customException(CoolSharkException e){
        log.info(e.getMessage());
        return JsonResult.failed(e.getCode(),e.getMessage());
    }
    */
/**
     * 系统异常
     *//*

    @ExceptionHandler({Throwable.class})
    public JsonResult systemError(Throwable e){
        log.info(e.getMessage());
        return JsonResult.failed(500,e.getMessage());
    }
    */
/**
     * 绑定异常
     *//*

    @ExceptionHandler({BindException.class})
    public JsonResult systemError(BindException e){
        log.info(e.getMessage());
        String message=e.getBindingResult().getFieldError().getDefaultMessage();
        return JsonResult.failed(400,message);
    }

}
*/
